home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / Tool Chest / Text / WASTE / WASTE 1.1.2 Distribution / Pseudo-UPI for THINK Pascal / Menus.p < prev    next >
Encoding:
Text File  |  1995-10-12  |  3.4 KB  |  133 lines  |  [TEXT/PJMM]

  1. unit Menus;
  2.  
  3. { Pascal Interface to the Macintosh Libraries }
  4.  
  5. { Copyright © Apple Computer Inc. }
  6. { All Rights Reserved }
  7.  
  8. { Adapted for use with THINK Pascal 4.0.x by Marco Piovanelli }
  9.  
  10. interface
  11.     uses
  12.         Types;
  13.  
  14.     type
  15.  
  16.         MenuRef = MenuHandle;
  17.  
  18.         MenuDefProcPtr = ProcPtr;  { PROCEDURE MenuDef(message: INTEGER; theMenu: MenuRef; VAR menuRect: Rect; hitPt: Point; VAR whichItem: INTEGER); }
  19.         MenuBarDefProcPtr = ProcPtr;  { FUNCTION MenuBarDef(selector: INTEGER; message: INTEGER; parameter1: INTEGER; parameter2: LONGINT): LONGINT; }
  20.         MenuHookProcPtr = ProcPtr;  { PROCEDURE MenuHook; }
  21.         MBarHookProcPtr = ProcPtr;  { FUNCTION MBarHook(VAR menuRect: Rect): INTEGER; }
  22.         MenuDefUPP = UniversalProcPtr;
  23.         MenuBarDefUPP = UniversalProcPtr;
  24.         MenuHookUPP = UniversalProcPtr;
  25.         MBarHookUPP = UniversalProcPtr;
  26.  
  27.     const
  28.         uppMenuDefProcInfo = $0000FF80; { PROCEDURE (2 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param); }
  29.         uppMenuBarDefProcInfo = $00003AB0; { FUNCTION (2 byte param, 2 byte param, 2 byte param, 4 byte param): 4 byte result; }
  30.         uppMenuHookProcInfo = $00000000; { PROCEDURE ; }
  31.         uppMBarHookProcInfo = $000000CF; { SPECIAL_CASE_PROCINFO( kSpecialCaseMBarHook ) }
  32.  
  33.     function NewMenuDefProc (userRoutine: MenuDefProcPtr): MenuDefUPP;
  34.     inline
  35.         $2E9F;
  36.  
  37.     function NewMenuBarDefProc (userRoutine: MenuBarDefProcPtr): MenuBarDefUPP;
  38.     inline
  39.         $2E9F;
  40.  
  41.     function NewMenuHookProc (userRoutine: MenuHookProcPtr): MenuHookUPP;
  42.     inline
  43.         $2E9F;
  44.  
  45.     function NewMBarHookProc (userRoutine: MBarHookProcPtr): MBarHookUPP;
  46.     inline
  47.         $2E9F;
  48.  
  49.     procedure CallMenuDefProc (message: INTEGER;
  50.                                     theMenu: MenuRef;
  51.                                     var menuRect: Rect;
  52.                                     hitPt: Point;
  53.                                     var whichItem: INTEGER;
  54.                                     userRoutine: MenuDefUPP);
  55.     inline
  56.         $205F, $4E90;
  57.  
  58.     function CallMenuBarDefProc (selector: INTEGER;
  59.                                     message: INTEGER;
  60.                                     parameter1: INTEGER;
  61.                                     parameter2: LONGINT;
  62.                                     userRoutine: MenuBarDefUPP): LONGINT;
  63.     inline
  64.         $205F, $4E90;
  65.  
  66.     procedure CallMenuHookProc (userRoutine: MenuHookUPP);
  67.     inline
  68.         $205F, $4E90;
  69.  
  70.     function CallMBarHookProc (var menuRect: Rect;
  71.                                     userRoutine: MBarHookUPP): INTEGER;
  72.     {To be implemented:  Glue to move parameters according to special case conventions.}
  73.  
  74.     function GetMBarHeight: INTEGER;
  75.     inline
  76.         $3EB8, $0BAA;            { move.w MBarHeight, (sp) }
  77.  
  78.     procedure AppendResMenu (theMenu: MenuRef;
  79.                                     theType: ResType);
  80.     inline
  81.         $A94D;
  82.  
  83.     procedure InsertMenuItem (theMenu: MenuRef;
  84.                                     itemString: ConstStr255Param;
  85.                                     afterItem: INTEGER);
  86.     inline
  87.         $A826;
  88.  
  89.     procedure DeleteMenuItem (theMenu: MenuRef;
  90.                                     item: INTEGER);
  91.     inline
  92.         $A952;
  93.  
  94.     procedure SetMenuItemText (theMenu: MenuRef;
  95.                                     item: INTEGER;
  96.                                     itemString: ConstStr255Param);
  97.     inline
  98.         $A947;
  99.  
  100.     procedure GetMenuItemText (theMenu: MenuRef;
  101.                                     item: INTEGER;
  102.                                     var itemString: Str255);
  103.     inline
  104.         $A946;
  105.  
  106.     function GetMenuHandle (menuID: INTEGER): MenuRef;
  107.     inline
  108.         $A949;
  109.  
  110.     procedure DeleteMCEntries (menuID: INTEGER;
  111.                                     menuItem: INTEGER);
  112.     inline
  113.         $AA60;
  114.  
  115.     procedure DisposeMCInfo (menuCTbl: MCTableHandle);
  116.     inline
  117.         $AA63;
  118.  
  119.     procedure InsertFontResMenu (theMenu: MenuRef;
  120.                                     afterItem: INTEGER;
  121.                                     scriptFilter: INTEGER);
  122.     inline
  123.         $303C, $0400, $A825;
  124.  
  125.     procedure InsertIntlResMenu (theMenu: MenuRef;
  126.                                     theType: ResType;
  127.                                     afterItem: INTEGER;
  128.                                     scriptFilter: INTEGER);
  129.     inline
  130.         $303C, $0601, $A825;
  131.  
  132. implementation
  133. end.